<style>
    .ivu-table .demo-table-info-cell-name {
        background-color: #f51b16;
        color: #fff;
    }
    .ivu-table .demo-table-info-cell-age {
        background-color: #6dff33;
        color: #fff;
    }
</style>
<template>
    <div>
        <p>Custom arbitrary cell styles:</p>
        <Table :columns="columns1" :data="data8"></Table>
    </div>
</template>
<script>
    export default {
        data () {
            return {
                columns1: [
                    {
                        title: '类别',
                        key: 'name'
                    },
                    {
                        title: '活跃度',
                        key: 'age'
                    },
                    {
                        title: '备注',
                        key: 'address'
                    }
                ],
                data8: [
                    {
                        name: '个人活跃度',
                        age: 18,
                        address: 'New York No. 1 Lake Park'
                    },
                    {
                        name: '个人活跃度',
                        age: 100,
                        address: 'London No. 1 Lake Park',
                        cellClassName: {
                            age: 'demo-table-info-cell-age',
                        }
                    },
                    {
                        name: '个人活跃度',
                        age: 30,
                        address: 'Sydney No. 1 Lake Park'
                    },
                    {
                        name: '个人活跃度',
                        age: 0,
                        address: 'Ottawa No. 2 Lake Park',
                        cellClassName: {
                            age: 'demo-table-info-cell-name'
                        }
                    }
                ]
            }
        },
        methods: {
            rowClassName (row, index) {
                if (index === 1) {
                    return 'demo-table-info-row';
                } else if (index === 3) {
                    return 'demo-table-error-row';
                }
                return '';
            }
        }
    }
</script>
